package per.srp.demo.carLink.Utils;
public abstract class MyThread{


    private Thread newTask(){
        MyThread that = this;
        Thread t = new Thread(new Runnable() {
            @Override
            public void run() {
                that.run();
            }
        });
        return t;
    }

    public MyThread(){
        Thread t = newTask();
        t.start();
    }

    public MyThread(boolean daemon){
        Thread t = newTask();
        t.setDaemon(daemon);
        t.start();
    }

    public abstract void run();

}
